<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SetGadgetColor</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SetGadgetColor()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>SetGadgetColor</b></font>(#Gadget, ColorType, Color)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Changes a color attribute on the given gadget. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
 
The gadget to use. 

 

</td></tr>
<tr><td><i>ColorType</i></td>
<td> 
 
The kind of color attribute to change. This can be one of the following values. 
See the documentation of each gadget for the supported color attributes: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Gadget_FrontColor</font>     : Gadget text
  <font color="#924B72">#PB_Gadget_BackColor</font>      : Gadget background
  <font color="#924B72">#PB_Gadget_LineColor</font>      : Color for gridlines
  <font color="#924B72">#PB_Gadget_TitleFrontColor</font>: Text color in the title        (for <a href="calendargadget.html">CalendarGadget()</a>)
  <font color="#924B72">#PB_Gadget_TitleBackColor</font> : Background color in the title  (for <a href="calendargadget.html">CalendarGadget()</a>)
  <font color="#924B72">#PB_Gadget_GrayTextColor</font>  : Color for grayed out text      (for <a href="calendargadget.html">CalendarGadget()</a>)
</font></pre>

</td></tr>
<tr><td><i>Color</i></td>
<td> 
 
The new color for the attribute. <a href="../2ddrawing/rgb.html">RGB()</a> can be 
used to get a valid color value. To remove the custom color and go back to the default system color, set 
the 'Color' parameter to -1. 

 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

None.





</blockquote><p><b>Remarks</b></p><blockquote>



This function is supported by the following gadgets: 
<br>
<br>
- <a href="calendargadget.html">CalendarGadget()</a> 
<br>
- <a href="containergadget.html">ContainerGadget()</a> 
<br>
- <a href="dategadget.html">DateGadget()</a> 
<br>
- <a href="editorgadget.html">EditorGadget()</a> 
<br>
- <a href="explorerlistgadget.html">ExplorerListGadget()</a> 
<br>
- <a href="explorertreegadget.html">ExplorerTreeGadget()</a> 
<br>
- <a href="hyperlinkgadget.html">HyperLinkGadget()</a> 
<br>
- <a href="listviewgadget.html">ListViewGadget()</a> 
<br>
- <a href="listicongadget.html">ListIconGadget()</a> 
<br>
- <a href="mdigadget.html">MDIGadget()</a> 
<br>
- <a href="progressbargadget.html">ProgressBarGadget()</a> (Windows only) 
<br>
- <a href="scrollareagadget.html">ScrollAreaGadget()</a> 
<br>
- <a href="spingadget.html">SpinGadget()</a> 
<br>
- <a href="stringgadget.html">StringGadget()</a> 
<br>
- <a href="textgadget.html">TextGadget()</a> 
<br>
- <a href="treegadget.html">TreeGadget()</a> 

<br>
<br>
<b>Note:</b> With activated Windows XP style the color settings will probably be ignored 
or overwritten by the style. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 200, 170, "SetGadgetColor", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    StringGadget</font>(0, 10, 10, 180, 20, "String...")
<font color="#006666">    ListViewGadget</font>(1, 10, 40, 180, 60)
    <b><font color="#006666">For</font></b> i = 0 <b><font color="#006666">To</font></b> 4
<font color="#006666">      AddGadgetItem</font>(1, -1, "Text")
    <b><font color="#006666">Next</font></b> i
<font color="#006666">    ContainerGadget</font>(2, 10, 110, 180, 50, <font color="#924B72">#PB_Container_Raised</font>)

<font color="#006666">    SetGadgetColor</font>(0, <font color="#924B72">#PB_Gadget_BackColor</font>, $00FFFF)
<font color="#006666">    SetGadgetColor</font>(1, <font color="#924B72">#PB_Gadget_FrontColor</font>, $FFFFFF)
<font color="#006666">    SetGadgetColor</font>(1, <font color="#924B72">#PB_Gadget_BackColor</font>, $000000)
<font color="#006666">    SetGadgetColor</font>(2, <font color="#924B72">#PB_Gadget_BackColor</font>, $0000FF)

    <b><font color="#006666">Repeat</font></b>
    <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/setgadgetcolor.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetcolor.html">GetGadgetColor()</a>, <a href="getgadgetitemcolor.html">GetGadgetItemColor()</a>, <a href="setgadgetitemcolor.html">SetGadgetItemColor()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=setgadgetattribute.html>SetGadgetAttribute()</a> - <a href=index.html>Gadget Index</a> - <a href=setgadgetdata.html>SetGadgetData()</a> -&gt;



</body></html>